/**
 * 登录日志表格列
 */
import { ref, h } from 'vue'
import { user } from '../../../entity/system/user'
import { TableColumnProps } from '../../../components/base/table/table-props'
import { LoginLog } from '../../../entity/system/login-log'

export const columns: Array<TableColumnProps<LoginLog>> = [
  {
    title: '编号',
    // @ts-ignore
    customRender: ({ index }) => index + 1,
    width: 60,
    align: 'center',
  },
  {
    title: 'ip',
    dataIndex: 'ip',
    width: 100,
  },
  {
    title: '登录状态',
    dataIndex: 'status',
    width: 120,
  },
  {
    title: '用户名',
    width: 100,
    dataIndex: 'userName',
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    customRender: ({ record }) => (record.createTime ? record.createTime.replace('T', ' ') : ''),
    width: 200,
  },
  {
    title: '操作',
    dataIndex: 'action',
    width: 200,
    align: 'center',
    fixed: 'right',
  },
]
